﻿using System;
using AccessControl.Common;
using AccessControl.DataAcess;


namespace AccessControl.Business
{
	public class FingerCollectionBusiness
	{
		readonly FingerCollectionAccess _fingerCollectionAccess=new FingerCollectionAccess();

		public void Insert(AccessControlDS.FingerCollectionRow row)
		{
			row.DateRegistered = Util.GetServerDateTime();
			_fingerCollectionAccess.Insert(row);
		}

		public bool IsStudentRegistered(String studentCode)
		{
			return _fingerCollectionAccess.CountByStudent(studentCode) != 0;
		}

		public void DeleteByStudentCode(String studentCode)
		{
			_fingerCollectionAccess.DeleteByStudentCode(studentCode);
		}
        public void UpdateTemplate(String fkPerson, byte fingerIndex, int G, byte[] template)
        {
            _fingerCollectionAccess.UpdateTemplate(fkPerson,fingerIndex,G,template);
        }
    }
}
